package BLL;/*
    张昊（java文件）
 
*/

import DAL.LogDao;
import DAL.ReaderTypeDao;
import Entity.Category;

import java.util.Date;
import java.util.List;

public class ReaderTypeService {
    private static LogDao ld=new LogDao();
    private static ReaderTypeDao rtd=new ReaderTypeDao();
    //添加读者类别
    public static int addReaderType(Object... args){
        Date date=new Date();
        String s="添加了读者类别信息！";
        ld.insertloginLog(date,s);
        return rtd.addReaderType(args);
    }
    //修改读者类别
    public static int updateReaderType(Object... args){

        Date date=new Date();
        String s="修改了读者类别信息！";
        ld.insertloginLog(date,s);
        return rtd.updateReaderType(args);
    }
    //查看读者类别
    public static List<Category> selectReaderType(){

        Date date=new Date();
        String s="查看了读者类别信息！";
        ld.insertloginLog(date,s);
        return rtd.selectAllReaderType();
    }
    //删除读者类别
    public static int deleteReaderType(Object... args){

        Date date=new Date();
        String s="删除了读者类别信息！";
        ld.insertloginLog(date,s);
        return rtd.deleteReaderType(args);
    }
    //根据读者类型名称查询
    public static Category selectReaderTypeName(Object... args){
        Category category = rtd.selectReaderType(args);
        Date date=new Date();
        String s="根据读者类型名称查询！";
        ld.insertloginLog(date,s);
        return category;
    }
    //根据读者类型编号查询
    public static Category selectReaderTypeNumber(Object... args){
        Category category = rtd.selectReaderTypeId(args);
        Date date=new Date();
        String s="根据读者类型编号查询！";
        ld.insertloginLog(date,s);
        return category;
    }
}
